package org.example.util;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @author 张在成
 *
 * 响应状态实体
 *
 */
@Data
@AllArgsConstructor
public class R<T> {

    private  int code;

    private  String  msg;

    private  T  data;

    public <T> R(String msg, T data) {
    }

    public R(int code, String msg) {
    }


    public static <T> R data(int code, String msg, T data){
        return new R(code,msg,data);
    }

    public  static <T> R data(String msg, T data){
        return  new R(msg,data);
    }

    public  static <T> R data(int code,String msg){
        return  new R(code,msg);
    }


}
